home *** CD-ROM | disk | FTP | other *** search
/ Explorers of the New World / Explorers of the New World.iso / pc / exhelp.dir / 00038_PAGES.ls < prev    next >
Encoding:
Text File  |  1995-09-06  |  2.3 KB  |  91 lines

  1. on showPage direction
  2.   global textSprite
  3.   set nextPageCastNumber to getNextPageCast(direction)
  4.   set the castNum of sprite textSprite to nextPageCastNumber
  5.   setTopicTextAttributes(nextPageCastNumber)
  6.   updateCurrentPage(direction)
  7.   showMoreButtons()
  8.   updateStage()
  9. end
  10.  
  11. on resetCurrentPage
  12.   global currentPage
  13.   set currentPage to 1
  14. end
  15.  
  16. on updateCurrentPage direction
  17.   global currentPage
  18.   set currentPage to currentPage + direction
  19. end
  20.  
  21. on setCurrentPage
  22.   global currentPage, textSprite
  23.   set currentPage to value(the last char in the name of cast the castNum of sprite textSprite)
  24. end
  25.  
  26. on getNextPageCast direction
  27.   global textSprite, currentPage
  28.   set currentCastName to the name of cast the castNum of sprite textSprite
  29.   set numCharsInName to the number of chars in currentCastName
  30.   set nextPageCastName to char 1 to numCharsInName - 1 of currentCastName & string(currentPage + direction)
  31.   return the number of cast nextPageCastName
  32. end
  33.  
  34. on showMoreButtons
  35.   global pageUpButton, pageDownButton
  36.   if morePagesExist(-1) then
  37.     set upStatus to 1
  38.   else
  39.     set upStatus to 0
  40.   end if
  41.   if morePagesExist(1) then
  42.     set downStatus to 1
  43.   else
  44.     set downStatus to 0
  45.   end if
  46.   if upStatus and downStatus then
  47.     showPageUpButton("Enabled")
  48.     showPageDownButton("Enabled")
  49.   end if
  50.   if upStatus and not downStatus then
  51.     showPageUpButton("Enabled")
  52.     showPageDownButton("Disabled")
  53.   end if
  54.   if not upStatus and downStatus then
  55.     showPageDownButton("Enabled")
  56.     showPageUpButton("Disabled")
  57.   end if
  58.   if not upStatus and not downStatus then
  59.     removeMoreButtons()
  60.   end if
  61. end
  62.  
  63. on removeMoreButtons
  64.   global pageUpButton, pageDownButton
  65.   removeFromStage(pageUpButton)
  66.   removeFromStage(pageDownButton)
  67. end
  68.  
  69. on morePagesExist direction
  70.   set nextPageCastNumber to getNextPageCast(direction)
  71.   if nextPageCastNumber <> -1 then
  72.     return 1
  73.   else
  74.     return 0
  75.   end if
  76. end
  77.  
  78. on showPageUpButton status
  79.   global pageUpButton, pageUpH, pageUpV
  80.   changeButtonCast(pageUpButton, status)
  81.   set the locH of sprite pageUpButton to pageUpH
  82.   set the locV of sprite pageUpButton to pageUpV
  83. end
  84.  
  85. on showPageDownButton status
  86.   global pageDownButton, pageDownH, pageDownV
  87.   changeButtonCast(pageDownButton, status)
  88.   set the locH of sprite pageDownButton to pageDownH
  89.   set the locV of sprite pageDownButton to pageDownV
  90. end
  91.